{extend name="base"/}
{block name="title"}
   支付
{/block}
{block name="css"}
<link rel="stylesheet" href="__MOBILE__/css/zhang.css">
{/block}
{block name="content"}
<div class="head">
    <div class="head_left"><a href="javascript:history.go(-1)"><img src="__MOBILE__/images/true.png" alt=""></a></div>
    <div class="head_con">支付</div>
    <div class="head_right"></div>
</div>

<div class="zhi_goods">
{volist name="res" id="vo"}
{volist name="vo.goods" id="vos"}
<ul id="pay">
  
    <li>
        <div class="list_t">
            <a href="/shop/store/mallxq.html">
                <img src="/static/langjinmobile/images/proto.png" alt="">
                <h4>{:lang('店铺')}{$vo.business.name}</h4>
                
                <p class="desc">{$vos.good_name}</p>
                <div class="con_right">
                    <p class="mon">￥
                        <span class="yue">{$vos.wallet_num}</span>+
                        <span class="jfen">{$vos.integral_num}</span>GMOD
                    </p>
                    <p class="onum">x<span class="jian">{$vos.num}</span></p>
                </div>
                
            </a>
        </div>
    </li>
    
</ul>
{/volist}
{/volist}
</div>

<div class="dist">配送方式<p class="dist_ch">普通快递</p></div>
<div class="payway">
    <img src="/static/langjinmobile/images/payway.png" alt="">
    <span class="overpay">GMOBGMOD支付</span>
    <input type="checkbox" class="zhipay" checked="checked">
</div>

<div class="zhis">确认支付</div>



<div class="ftc_wzsf" >
    <div class="srzfmm_box">
        <div class="qsrzfmm_bt clear_wl">
            <img src="__MOBILE__/images/xx_03.jpg" class="tx close fl">
            <span class="fl">请输入支付密码</span></div>
        <div class="zfmmxx_shop">
            <div class="mz">￥123</div>
            <div class="zhifu_price"></div></div>
        <ul class="mm_box">
            <li></li><li></li><li></li><li></li><li></li><li></li>
        </ul>
    </div>
    <div class="numb_box">
        <div class="xiaq_tb">
            <img src="__MOBILE__/images/jftc_14.jpg" height="10"></div>
        <ul class="nub_ggg">
            <li><a href="javascript:void(0);" class="zf_num">1</a></li>
            <li><a href="javascript:void(0);" class="zj_x zf_num">2</a></li>
            <li><a href="javascript:void(0);" class="zf_num">3</a></li>
            <li><a href="javascript:void(0);" class="zf_num">4</a></li>
            <li><a href="javascript:void(0);" class="zj_x zf_num">5</a></li>
            <li><a href="javascript:void(0);" class="zf_num">6</a></li>
            <li><a href="javascript:void(0);" class="zf_num">7</a></li>
            <li><a href="javascript:void(0);" class="zj_x zf_num">8</a></li>
            <li><a href="javascript:void(0);" class="zf_num">9</a></li>
            <li><a href="javascript:void(0);" class="zf_empty">{:lang('清空')}</a></li>
            <li><a href="javascript:void(0);" class="zj_x zf_num">0</a></li>
            <li><a href="javascript:void(0);" class="zf_del">{:lang('删除')}</a></li>
        </ul>
    </div>
    <div class="hbbj"></div>
</div>

{/block}
{block name="js"}
<script type="text/javascript">
    $(".zhis").click(function(){
        $(".ftc_wzsf").show();
        var att = 0;
        var jifen = 0;
        var len = $("#pay li").length;
        for(var i = 0; i < len; i++){
         var nums = Number($("#pay li").eq(i).find(".jian").html());
         att += Number($("#pay li").eq(i).find(".yue").html()) * nums;
         jifen += Number($("#pay li").eq(i).find(".jfen").html()) * nums;
        }
        $(".mz").html(att +' GMOB '+ jifen +' GMOD');
    });
</script>
<script type="text/javascript">
    $(function(){
    //关闭浮动
    $(".close").click(function(){
      $(".ftc_wzsf").hide();
      $(".mm_box li").removeClass("mmdd");
      $(".mm_box li").attr("data","");
      i = 0;
    });
      //数字显示隐藏
    $(".xiaq_tb").click(function(){
      $(".numb_box").slideUp(500);
    });
    $(".mm_box").click(function(){
      $(".numb_box").slideDown(500);
    });
      //----
    var i = 0;
    $(".nub_ggg li .zf_num").click(function(){
          
      if(i<6){
          $(".mm_box li").eq(i).addClass("mmdd");
          $(".mm_box li").eq(i).attr("data",$(this).text());
          i++
          if (i==6) {
            setTimeout(function(){
              var pwd = "";
                  $(".mm_box li").each(function(){
                  pwd += $(this).attr("data");
              });
    
              console.log(1);
                //ajax提交密码
                $.ajax({
                    url:'/langjinmobile/Card/zhiok',
                    type:'POST',
                    data:{'pwd':pwd},
                    datatype:'json',
                    success: function(mes) {
                      console.log(mes);
                      //console.log(1);return false;
                        if(mes.status == 1){
                          msg_alert('购买成功');
                          window.location.href = "/langjinmobile/home/index";   
                            $(".ftc_wzsf").hide();
                            $(".mm_box li").removeClass("mmdd");
                            $(".mm_box li").attr("data","");
                            i = 0;
                             
                        }else{
                            msg_alert(mes.msg);
                            $(".mm_box li").removeClass("mmdd");
                            $(".mm_box li").attr("data","");
                            i = 0;
                        }
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                      console.log(XMLHttpRequest.status);
                      console.log(XMLHttpRequest.readyState);
                      console.log(textStatus);
                      },
                })
            },1000);
          };
      }
    });
    $(".nub_ggg li .zf_del").click(function(){
      if(i>0){
          i--
          $(".mm_box li").eq(i).removeClass("mmdd");
          $(".mm_box li").eq(i).attr("data","");
      }
    });
    
    $(".nub_ggg li .zf_empty").click(function(){
      $(".mm_box li").removeClass("mmdd");
      $(".mm_box li").attr("data","");
      i = 0;
    });
    
    });
    </script>
{/block}